package com.example.tests;


import static org.junit.Assert.assertThat;
import static org.hamcrest.Matchers.*;
import org.testng.annotations.Test;
import com.example.utils.SortedListOf;

public class GroupRemovalTests extends TestBase{
	
	@Test
	
	public void deleteSomeGroupe(){
	    
	    //save old state
		SortedListOf<GroupData> oldList =  app.getGroupHelper().getGroups();
	    
	    int index = getRandomIndex(oldList.size());
	    
	    
	    //actions
		app.getGroupHelper().deleteGroup(index);

		
	    //save new state
		SortedListOf<GroupData> newList =  app.getGroupHelper().getGroups();   
	    
	    //compare states    
	    assertThat(newList, equalTo(oldList.without(index)));
	
		
	}

}
